{extend name="public/base"}

{block name="title"}就行天下-个人中心{/block}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/home/css/index.css" />
{/block}


{block name="main"}
<div class="pageControl lookIndent bg-f7">
    <div class="main-top"></div>
    <div class="msui_nav msui_navTop">
        <a class="msui_navTop-back" href="javascript:history.back();"><i class="micon-back"></i></a>
        <h1 class="msui_navTop-title">全部订单</h1>
        <a href="" class="msui_navTop-right msui_navTop-cnav"><i class="micon-cnav"></i></a>
    </div>
    <div class="indent-top">

    </div>
</div>
<!--收货成功-->
<div id="takeSucc"  class="weui-popup__container close-popup">
    <div class="weui-popup__overlay"></div>
    <div class="weui-popup__modal">
        <div class="modal-content bg-f5">
            <div>
                <img src="__STATIC__/home/images/succ3.png" alt="">
            </div>
        </div>
    </div>
</div>
{/block}

{block name="javascript"}
<script src="__STATIC__/home/js/order.js"></script>
<script>
    $(function () {
        var obj = {
            'is_more' : true,
            'page' : 1,
            'url' : '{:url("index")}'
        };

        get_order_list();
        $(window).scroll( function() {
            if (($(document).height() - $(this).scrollTop() - $(this).height()<50) && obj.is_more){
                get_order_list();
            }
        });

        function get_order_list() {
            $.showLoading();
            obj.is_more = false;
            $.ajax({
                type : 'GET',
                url : obj.url + '?page=' + obj.page,
                dataType : 'json',
                success : function (msg) {
                    $.hideLoading();
                    if (obj.page == 1) {
                        $(".indent-top").html(msg.tpl);
                    } else {
                        $(".indent-top").append(msg.tpl);
                    }
                    // 计算是否还有更多数据
                    if (msg.data.is_more > 0) {
                        obj.is_more = true;
                    }
                    obj.page++;
                }
            });
        }

        //        遍历星星分数得到个数
        $('.xx').each(function () {
            var exclusiveCount=parseInt($(this).next().html()) ;
            for(var i=1;i<=exclusiveCount;i++) {
                $(this).find('span').eq(i-1).addClass('active');

            }
        })

    });
</script>
{/block}